<?php

namespace app\api\validate;

use think\Validate;

class Cluster extends Validate
{
    protected $rule = [
        ['id',           'require|number|>:0',                     '请先选择群聊|请先选择群聊|请先选择群聊'],
        ['status',       'require|number|in:0,1',                  '编辑状态有误|编辑状态有误|编辑状态有误'],
        ['type',         'require|number',                         '消息类型有误|消息类型有误'],
        /*['content',      'require',                                '内容不能为空'],*/
        ['cluster_id',   'require|number|>:0',                     '请先选择群聊|请先选择群聊|请先选择群聊'],
        ['types',        'require|number|in:1,2,3',                '请先选择类型|请先选择类型|请先选择类型'],
        ['chat_id',      'require|number|>:0',                     '请先选择红包|请先选择红包|请先选择红包'],
        ['num',          'number|>:0',                             '数量有误|数量有误'],
        ['paypwd',       'number|length:6',                         '提现密码错误|提现密码错误'],
    ];

    protected $scene = [
        'status'         => ['id', 'status'],
        'users'          => ['id'],
        'addTalk'        => ['cluster_id', 'type', 'content', 'num', 'paypwd'],
        'getMsgList'     => ['cluster_id'],
        'changeread'     => ['cluster_id'],
        'ranking'        => ['id', 'types'],
        'receiveStatus'  => ['chat_id'],
        'relateCount'    => ['cluster_id'],
        'signIn'         => ['cluster_id'],
    ];
}

